The present invention is directed to a method for controlling the speed of a fluid pump in accordance with a measured fluid level and a method to determine the fluid level by transmitting a sonic pulse into the well casing, detecting reflections of the sonic pulse from collars on the tubing inside the well casing, detecting the pulse reflected from the fluid surface and accumulating distance for the collars from the top of the well to the point of reflection from the surface.
According to the invention, fluid production from a well can be increased without pumping the well dry, by controlling pumping capacity of the pump. Pumping capacity can be controlled by, for example, adjusting the speed of a reciprocating, rotary or submersible pump. To prevent the pump from running dry, the level of the fluid is measured using a fluid level measuring instrument and a minimum fluid head is maintained above the inlet to the pump. The fluid level instrument operates by sending an acoustic pulse into an annulus between the well casing and the production tubing and sensing reflections of the acoustic pulse from collars on the tubing and a reflection from the fluid surface. Since the collar spacing on the production tubing is known, the distance from the top of the well to the surface of the fluid can be obtained by accumulating the distance associated with the collars detected in the reflection signal.